export function getFileType(file: File) {
  const fileName = file.name || "";
  const extension = fileName.split(".")?.pop()?.toLowerCase() || "";

  const fileTypes = {
    Pdf: ["pdf"],
    Word: ["doc", "docx"],
    Excel: ["xls", "xlsx"],
    Ppt: ["ppt", "pptx"],
    Image: ["jpg", "jpeg", "png", "gif", "bmp", "svg"],
    Audio: ["mp3", "wav", "aac", "ogg"],
    Video: ["mp4", "avi", "mov", "wmv", "mkv"],
  };

  return (
    Object.entries(fileTypes).find(([, extensions]) =>
      extensions.includes(extension)
    )?.[0] || "Unknown"
  );
}
